package net.tycmc.cty.ctyms.timejob.iems.job;

import net.tycmc.cty.ctyms.timejob.common.DateControl;
import net.tycmc.cty.ctyms.timejob.iems.service.FileToFTPService;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * 定时作业 数据记录文件上传至CTY 的FTP服务器中
 * 
 * @author LXF	20140529
 * 
 */
public class FileToFTPJob extends QuartzJobBean {

	private FileToFTPService jobData;

	/**
	 * 数据记录文件上传至FTP服务器中：每天3:00调用一次。 
	 */
	@Override
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		
		System.out.println(DateControl.getDateTime(0)+"数据记录文件上传至FTP服务器Job开始");
		long startMili_t=System.currentTimeMillis();// 当前时间对应的毫秒数
		this.jobData.fileToFTP();
		long endMili_t=System.currentTimeMillis();
		System.out.println(DateControl.getDateTime(0)+"数据记录文件上传至FTP服务器Job结束，用时："+(endMili_t-startMili_t)+"  毫秒");
	}

	public FileToFTPService getJobData() {
		return jobData;
	}

	public void setJobData(FileToFTPService jobData) {
		this.jobData = jobData;
	}
}
